import React from 'react';
import { RootState } from '../store'
import { connect } from 'react-redux'
import { login } from '../actions/MyAction'
import { AccessToken } from '../reducers/MyReducers'
import { ThunkDispatch } from 'redux-thunk'
class TestA extends React.Component <any,any>{
    constructor(props:any) {
        super(props);
        this.state={
            count:0,
        }
      
    }
    componentDidUpdate(prevProps:any, prevState:any) {
        if (prevState.count !== this.state.count) {
          document.title = `You clicked ${this.state.count} times`;
        }
      }
    componentDidMount(){
        
        const arr1  = ['温情', '刘聪']
        const arr2 = ['杨和苏', '邓紫棋']
        const arr3 = ['周延']
        const arr = arr1.concat(arr2, arr3)
        console.log("!!!",arr); 

        const arrb = [...arr1, ...arr2, ...arr3];
        console.log("arrb!!!",arr); 

        arr1.push(...arr2, ...arr3)
        console.log(arr1);  

        for(const i in arr2) {
            arr1.push(arr2[i])
        }
        console.log("----",arr1); 

        // arr1.push.apply(arr1, arr2)

        const obj1 = {name: '温情'}
        const obj2 = {age: '22'}
        const newObj = Object.assign({}, obj1, obj2);
        console.log("Object.assign:",newObj); 

        this.assign()
    }
    assign(){
        const obj1 = {name: {chinese: '杨和苏', english: 'keyNG'}}
        const newObj = Object.assign({}, obj1);
        console.log(newObj);  // name: {chinese: "杨和苏", english: "keyNG"}
        obj1.name.english = 'pig1';
        console.log("Object.assign b:",newObj);   // name: {chinese: "杨和苏", english: "pig"}
 
    }
    render(){
        return (
            <div>ssss</div>
        )
    }
 
}
export default TestA;